      
<?php

	$text = '<html xmlns="http://www.w3.org/1999/xhtml"> 
	<a href="http://www.micronet.com/" target="_blank" style="color:#0000FF ; text-decoration:none">www.micronet.com</a> </p> 
	<a href="http://www.nair-co.com/" target="_blank" style="color:#0000FF; text-decoration:none">www.nair-co.com</a></p> 
	<a href="http://www.idatix.com/" target="_blank" style="color:#0000FF; text-decoration:none">iDatix </a></p>
	<a name="articles" id="articles"></a>
	www.ojoin.com <br><p>  http://ojoin.com  </br>
	<img src="http://www.ipoditunesongo.com/LeadForce1/lf1-newsletter/july06/images/articles-title.jpg" width="688" height="68" align="absbottom">
	<map name="Map" id="Map"><area shape="rect" coords="15,49,223,101" href="http://www.leadformix.com/" target="_blank" alt="logo" /> 
	<a href="mailto:info@sitime.com">info@sitime.com</a>.
	<a href="http://www.sitime.com/mysitime-registration/registers?t=1">http://www.sitime.com/mysitime-registration/registers</a>
	background: rgb(255, 0, 0) url(../res/img/temp/634043/original/cc3d8715eed0c.jpg) repeat fixed left top; cursor: auto;
	<div id="divbg" style="background-color:#ff0000"><img id="bg" src="../res/img/temp/634043/original/cc3d8715eed0c.jpg" width="100%" height="100%" /></div>
	background-image: url(../res/img/temp/634043/original/cc3d8715eed0c.png);
	background: rgb(255, 0, 0) url(http://google.com/res/img/temp/634043/original/cc3_d8715eed0c.jpg) repeat fixed left top; cursor: auto;
	background: rgb(255, 0, 0) url(https://google.com/res/img/temp/634043/original/cc3_d8715eed0c.jpg) repeat fixed left top; cursor: auto;';

	/*if (isset($_POST['inputText'])) {
        	$text = $_POST['inputText']; 
	}*/
	
	$text = htmlspecialchars_decode($text);
	
	
	$regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
	if(preg_match_all("/$regexp/siU", $text, $matches)) {
		//print_r($matches); // = array of link addresses
		//print_r($matches[3]); // = array of link text - including HTML code
	}
	
	
	$pattern = "(((https?:((//)|(\\\\)))|(www.))[\w\d:#%/;$()~_?\\-=\.&]*)i";
	preg_match_all($pattern, $text, $matches);
	$urlArray = $matches[0];
	print_r($urlArray);
      
?>
